﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Td.Additional.Runtime
{
    /// <summary>
    /// Data received event arguments class
    /// </summary>
    public class DataReceivedEventArgs : EventArgs
    {
        #region Properties

        /// <summary>
        /// Gets or sets the data.
        /// </summary>
        /// <value>The data.</value>
        public Byte[] Data { get; private set; }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="DataReceivedEventArgs"/> class.
        /// </summary>
        /// <param name="data">The data.</param>
        public DataReceivedEventArgs(Byte[] data)
        {
            Data = data;
        }

        #endregion

        #region Overriden object member

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return Encoding.ASCII.GetString(Data);
        }

        #endregion
    }
}